import { getEchoTextByValue } from '@/utils/getUtils';
// 统一进价表列
const editUnifiedColumns = [
  {
    title: 'SKU编码',
    key: 'skuNo',
  },
  {
    title: '商品名称',
    key: 'productName',
  },
  {
    title: '规格',
    key: 'specDetailStr',
  },
  {
    title: '主计量单位',
    key: 'unitName',
  },
  {
    title: '进价类型',
    render: (h, { row }) => {
      return <span>{getEchoTextByValue({
        val: row.purchasePriceType, firstText: '统一进价', secondText: '区域进价'
      })}</span>;
    }
  },
  {
    title: '销售区域',
    key: 'saleAreaShortNames',
    sortable: true,
  },
  {
    title: '主计量进价',
    key: 'mainPurchasePrice',
    width: 180,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '加价类型',
    render: (h, { row }) => {
      return <span>{getEchoTextByValue({
        val: row.addPriceType, firstText: '固定金额', secondText: '比例'
      })}</span>;
    }
  },
  {
    title: '运费比例或金额',
    key: 'freightRatio',
    width: 180,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '包装比例或金额',
    key: 'packRatio',
    width: 180,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '加工费比例或金额',
    key: 'processChargesRatio',
    width: 180,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '返利折合比例或金额',
    key: 'rebateRatio',
    width: 180,
    type: 'inputNumChange',
    precision: 3
  },
  {
    title: '返利说明',
    key: 'rebateRatioDesc',
    type: 'inputNoLimit',
    width: 160,
    maxlength: 300
  },
  {
    title: '成本价',
    key: 'mainUnitCostPrice'
  },
  {
    title: '进价备注',
    key: 'purchasePriceNote',
    width: 200,
    type: 'inputNoLimit',
    maxlength: 200
  },
  {
    title: '发票类型',
    key: 'invoiceTypeName'
  },
  {
    title: '税率',
    key: 'taxRate'
  },
  {
    title: '操作',
    key: 'action',
    width: 120,
    fixed: 'right'
  }
];
// 区域进价表列
const editAreaColumns = [
  {
    title: '参照城市',
    key: 'templateCityName',
  },
  {
    title: '业务区域',
    key: 'templateCitySaleAreaName',
  },
  ...editUnifiedColumns
];

export default {
  editUnifiedColumns,
  editAreaColumns
}
